<?php $this->load->view('header'); ?>
<div id="title_background">
            <div class="wrapper"><!-- 900px wrapper -->
                
            	<h1>Galeri Foto</h1>
                <!--<span class="title_description">This is blog page with with image float. Here you could describe your page or leave it blank.</span>--->
                
            </div> <!-- 900px wrapper -->
        </div>
   	
	</div>
    <div class="cleaner"></div>
    <div id="position_navi"><a href="<?php echo base_url()."photos";?>">Photos</a> / Detail</a></div>
    <div id="content">   
		  <div id="sidebar_right">
			<?php $this->load->view('right_sidebar', $right_sidebar); ?>            
		</div>
	
   		<article class="sidebar_right">
        	<h2 class="blog_post_title"><a href=""><?php echo $photo['judul'];?></a></h2>
            <div class="blog_post_info_div">
                <span class="blog_post_info">Diunggah Oleh <?php echo $photo['writer'];?>, Pada <?php echo timestamp_to_date_time($photo['waktu_posting']); ?></span>
                <!--<span class="blog_post_info_right">3 Comments</span>-->
            </div>
        	<img class="blog_post_picture float" style="width:auto !important; height:auto !important" src="<?php echo base_url(). PHOTO_PATH . $photo['foto'];?>" />            
            <p><?php echo $photo['deskripsi'];?></p>
		</article>
		
		<!--<article class="sidebar_right">
        	<div class="share_this_article">
            	<span>Berbagi Foto:</span>
                <ul>
                    <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/facebook.png" alt="Facebook" /></a></li>
                    <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/flickr.png" alt="Flickr" /></a></li>
                    <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/linkedin.png" alt="Linkedin" /></a></li>
                    <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/twitter.png" alt="Twitter" /></a></li>
                    <li><a href="#"><img src="<?php echo base_url();?>images/social_icons/youtube.png" alt="Youtube" /></a></li>
                </ul>
            </div>
        </article>-->
		
		<article class="sidebar_right">
        	<div id="article_comments">
            	<div class="title">
                	<span><?php echo count($komentars);?> komentar </span>
                </div>
                <?php 
				//print_r($komentars);
				foreach($komentars as $komentar){ ?>
				<div class="comment">
					<img src="<?php echo base_url()."images/user_avatars/".$komentar['avatars_comment_writer'];?>" alt="" />
					<a href="<?php echo base_url()."users/index/".$komentar['id_user'];?>" class="comment_title"><?php echo $komentar['comment_writer'];?></a>
					<span class="comment_title_right"><?php echo elapsed_time($komentar['waktu_posting']);?></span>
					<p><?php echo $komentar['isi'];?></p>
				</div>
				<?php }?>          
            </div>
		</article>
		<article class="sidebar_right">
			<?php if($user){ ?>
			<form method="POST" class="contact_form">
				<span>Masukkan Komentar Anda:</span>
				<textarea name="komentar"></textarea>
				<input type="submit" value="submit" name="submit_komentar">
			</form>
			<?php }else{
				echo "<p style='color:red'>Anda harus login terlebih dahulu sebelum memasukkan komentar.</p>";
			} ?>
		</article>
		
		<div class="cleaner"></div>
    </div>
    </div>
	</div>
<?php $this->load->view('footer', $right_sidebar); ?>